<!DOCTYPE html>
<html>
<head>
	<title>推送记录</title>
	{{>/WEB-INF/pages/common/meta_base.part.html}}
	{{>/WEB-INF/pages/common/refs_base.part.html}}
</head>
<body>
{{>/WEB-INF/pages/common/layout_header.part.html}}
<div class="container">
	<ul class="breadcrumb">
	  <li><a href="{{ctx}}">首页</a></li>
	  <li><a href="{{ctx}}/system/cloud">云服务</a></li>
	  <li class="active">配置推送渠道</li>
	</ul>
	<hr class="hr1">
	<div class="hr-10"></div>
	<div class="hr-10"></div>
	<div class="hr-10"></div>
	{{#message}}
		<script type="text/javascript">
			bootbox.alert('<h4>{{message}}</h4>');
		</script>
	{{/message}}
	<ul class="nav nav-tabs">
		<li><a href="{{ctx}}/push/create?appId={{appId}}">推送消息</a></li>
		<li><a href="{{ctx}}/push?appId={{appId}}">推送历史</a></li>
		<li class="active"><a href="javascript:void(0);">配置管理</a></li>
	</ul>
	<div style="margin:10px 20px 10px">
<form id="search-form" class="form-inline" role="form" action="{{queryPath}}" method="get">
	<div class="form-group">
		<label class="sr-only" for="so_appid">应用ID</label>
		<select id="so_appid" name="q_EQ_appId" class="form-control" title="可查找的应用">
			{{#apps}}
			<option value="{{key}}" {{#selected}}selected{{/selected}}>{{value}}</option>
			{{/apps}}
		</select>
	</div>
	<button id="so_go" class="btn btn-default" type="submit"><span class="glyphicon glyphicon-search"></span>查找</button>
	<div class="form-group">
		<label class="sr-only">排序</label>
		<div class="btn-group">
		{{#sortInfo}}
		  <button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown">
		    排序：{{currentSortEntry.text}}
		    {{^noneSortEntry}}
			    {{#currentSortEntry.asc}}↑{{/currentSortEntry.asc}}
			    {{^currentSortEntry.asc}}↓{{/currentSortEntry.asc}}
		    {{/noneSortEntry}}
		    <span class="caret"></span>
		  </button>
		  <ul class="dropdown-menu" role="menu">
		  	{{#sortEntrys}}
		    <li>
		    	<a href="?st_{{name}}={{nextDir}}{{#filterExp}}&{{filterExp}}{{/filterExp}}">
		    	{{text}} 
		    	{{#selected}}
			    	{{#nextAsc}}↑{{/nextAsc}}
			    	{{^nextAsc}}↓{{/nextAsc}}
		    	{{/selected}}
		    	</a>
		    </li>
		    {{/sortEntrys}}
		  </ul>
		{{/sortInfo}}
		</div>
	</div>
	{{#otherParams}}
	<input type="hidden" name="{{key}}" value="{{value}}"/>
	{{/otherParams}}
</form>
    </div>
	<table id="contentTable" class="table table-striped table-bordered table-hover">
		<thead><tr>
		<th>应用名称</th>
		<th width="160px">创建时间</th>
		<th width="130px">APNS</th>
		<th width="130px">APNS Sandbox</th>
		<th width="130px">Openfire</th>
		<th width="30px">操作</th>
		</tr></thead>
		<tbody>
		{{#configs}}		
			<tr>
				<td><span data-toggle="tooltip" title="应用ID:{{bslAppId}}">{{bslAppName}}</span></td>
				<td>
					<script type="text/javascript">
						document.write($.format.date(
								"{{createTime}}",
								"yyyy-MM-dd HH:mm:ss"))
					</script>
				</td>
				<td>
					<a class="btn btn-info" href="{{ctx}}/push/config/channel?appKey={{appId}}&formType=apns" 
					data-toggle="tooltip" title="最后修改于:{{apnsConfig.updateTime}}">配置
					</a>
					{{^apnsConfig}}<small>(未配置)</small>{{/apnsConfig}}
				</td>
				<td>
					<a class="btn btn-info" href="{{ctx}}/push/config/channel?appKey={{appId}}&formType=apns_sandbox" 
					data-toggle="tooltip" title="最后修改于:{{apnsSandboxConfig.updateTime}}">配置
					</a>
					{{^apnsSandboxConfig}}<small>(未配置)</small>{{/apnsSandboxConfig}}
				</td>
				<td>
					<a class="btn btn-info" href="{{ctx}}/push/config/channel?appKey={{appId}}&formType=openfire">配置
					</a>
					{{^openfireConfig}}<small>(未配置)</small>{{/openfireConfig}}
				</td>
				<td><a class="btn btn-link" href="{{ctx}}/push/config/delete?id={{appId}}">删除</a>{{index}}</td>
			</tr>
		{{/configs}}
		</tbody>
	</table>
	{{#page}}
	{{>/WEB-INF/pages/common/pagination.part.html}}
	{{/page}}
	<div><a class="btn btn-primary" href="{{ctx}}/push/config/channel?create=true">新增应用配置</a></div>
	{{>/WEB-INF/pages/common/layout_footer.part.html}}
</div>	
</body>
</html>
